#include "dsp.h"
static unsigned char seg_com = 0;
static unsigned char dot_com = 255;
code unsigned char seg_value[10] = {0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
unsigned char buffer[8] = {0};

void seg_display(void)
{
	SEG(0xff);
	COM(1<<seg_com);
	if(seg_com ==  dot_com)
	{
		SEG(seg_value[buffer[seg_com]] && 0x7f);
	}
	else
	{
		SEG(seg_value[buffer[seg_com]]);
	}
	if(++seg_com == 8)
	{
		seg_com = 0;
	}
}